﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VatTuDTO;
using VatTuDAO;

namespace VatTuBUS1
{
    public class SanPhamBUS
    {
        public List<SanPhamDTO> SelectSanPham()
        {
            return new SanPhamDAO().SelectSanPham();
        }
        //---------------------------------------------------------
        public SanPhamDTO SelectSanPham(int maSanPham)
        {
            return new SanPhamDAO().SelectSanPham(maSanPham);
        }
        //----------------------------------------------------------------
        public List<SanPhamDTO> SelectSanPhamTheoLoai(int maLoaiSanPham)
        {
            return new SanPhamDAO().SelectSanPhamTheoLoai(maLoaiSanPham);
        }
        //----------------------------------------------------------------
        public List<SanPhamDTO> SelectSanPhamTheoChungLoai(int maChungLoai)
        {
            return new SanPhamDAO().SelectSanPhamTheoChungLoai(maChungLoai);
        }
        //-----------------------------------------------------------------
        public Boolean DeleteSanPham(int maSanPham)
        {
            return new SanPhamDAO().XoaSanPham(maSanPham);
        }
        //--------------------------------------------------------------
        public Boolean InsertSanPham(SanPhamDTO sp)
        {
            return new SanPhamDAO().ThemSanPham(sp);
        }
        //--------------------------------------------------------------
        public Boolean UpdateSanPham(SanPhamDTO sp)
        {
            return new SanPhamDAO().CapNhatSanPham(sp);
        }
    }
}
